package com.amigo.online.provider.search;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import com.amigo.online.provider.search.interceptor.TokenInterceptor;

@Configuration
public class AmigoOnlineProviderSearchAuthConfiguration extends WebMvcConfigurationSupport {
    @Bean
    public TokenInterceptor getTokenInterceptor() {
        return new TokenInterceptor();
    }

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration ir = registry.addInterceptor(getTokenInterceptor());
        ir.addPathPatterns("/**");
    }

}
